package com.pozu.new_retail.service.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.pozu.new_retail.dao.mapper.ShareRecordMapper;
import com.pozu.new_retail.dao.model.ShareRecord;
import com.pozu.new_retail.dao.vo.BriefUserVo;
import com.pozu.new_retail.service.ShareRecordService;

@Service("shareRecordService")
public class ShareRecordServiceImpl implements ShareRecordService {

	@Autowired
	private ShareRecordMapper shareRecordMapper;
	
	@Override
	public List<BriefUserVo> queryByShareId(long shareId) {
		return shareRecordMapper.queryByShareId(shareId);
	}

	@Override
	public ShareRecord queryByMap(HashMap<String, Object> map) {
		return shareRecordMapper.queryByMap(map);
	}

	@Override
	public int saveShareRecord(ShareRecord shareRecord) {
		
		shareRecord.setCreatedTime(System.currentTimeMillis());
		
		return shareRecordMapper.insertShareRecord(shareRecord);
	}

}
